<?php if (isset($categoria['children'])): ?>
<span>
        <?php
            foreach ($categoria['children'] as $child):
                if( $child['status'] == 1 ){
                    echo '<ul class="planoBorderSeparar">';
                    $link = 'JavaScript:void(0);';
                    if( $child['pagina_id'] != 0 )
                        $link = 'http://'.$_SERVER['SERVER_NAME'].'/paginas/index/'.$child['pagina_id'].'/'.$child['nome'];

                    if( $child['url'] != '' && $child['url'] != null )
                        $link = 'http://'.str_replace('http://', '', str_replace('{url_do_site}', $_SERVER['SERVER_NAME'], $child['url']));
        ?>
            <li class="inferior">
                <h1><a href="<?= $link; ?>"><?= $child['nome']; ?></a></h1>
                <?php echo $this->element('categorias_children2', array('categoria' => $child)); ?>
            </li>
           </ul> 
        <?php
                }
            endforeach;
        ?>
</span>
<?php endif; ?>